import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

// Press Shift twice to open the Search Everywhere dialog and type `show whitespaces`,
// then press Enter. You can now see whitespace characters in your code.
public class Main {
    private static final ExecutorService executor  = Executors.newFixedThreadPool(10);
    private static final ExecutorService executor2 = Executors.newCachedThreadPool();
    private static final ExecutorService executor3 = Executors.newSingleThreadExecutor();
    private static final ExecutorService executor4 = Executors.newScheduledThreadPool(10);



    public static void main(String[] args) {
        new Main()
                .hello();
    }

    void hello() {
        for (int i = 0; i < 5; i++) {
            executor.submit(new ThreadTwo());
//            executor.execute(new ThreadTwo());
        }
    }

    private class  ThreadTwo implements Runnable {
        @Override
        public void run() {
            for (int i = 0; i < 10; i++) {
                System.out.println("XXXXX" + i);
            }
        }
    }
}